<template>
  <div class="list-box">
    <slot name="header"></slot>
    <div class="list" :style="{ width, height }">
      <div class="no-data" v-show="length === 0">
        <div class="image-box">
          <img src="@/assets/images/other/que.png" alt="" />
        </div>
      </div>
      <slot></slot>
    </div>
  </div>
</template>

<script lang="ts" setup>

defineProps({
  width: { type: String, default: "100%" },
  height: { type: String, default: "100%" },
  labelStyle: { type: String, default: () => ({}) },
  labelList: { type: Array, default: () => [] },
  dataList: { type: Array, default: () => [] },
  length: { type: Number, default: 0 },
});
</script>

<style lang="scss" scoped>
.list-box {
  position: relative;
  padding: 0 16px;
  box-sizing: border-box;

  .list {
    width: 100%;
    height: 100%;
    margin-top: 16px;
    box-sizing: border-box;
    overflow: auto;

    .no-data {
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100%;

      .image-box {
        width: 200px;
      }
    }

    /* IE 10+ */

    /*滚动条里面轨道*/
    &::-webkit-scrollbar-track {
      // -webkit-box-shadow: inset 0 0 6px rgba(255, 255, 255, 0);
      // background-color: rgb(20, 19, 19);
    }

    /*定义滚动条整体的样式*/
    &::-webkit-scrollbar {
      margin-right: 20px;
      width: 15px !important;
      // background-color: rgb(20, 19, 19);
    }

    /*滚动条的样式*/
    &::-webkit-scrollbar-thumb {
      background: rgba(0, 200, 255, 0.2);
      border: 1px solid #00c8ff;
      border-radius: 8px;
    }

    .list-item {
      margin-bottom: 16px;
    }
  }
}
</style>
